package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * SysUser generated by hbm2java
 */
@Entity
@Table(name = "sys_user")
public class SysUser implements java.io.Serializable {

	private Long id;
	private UserBaseInfo userBaseInfoByOperatorId;
	private UserBaseInfo userBaseInfoByUserBaseInfoId;
	private UserBaseInfo userBaseInfoByCreaterId;
	private String userName;
	private String userPassword;
	private byte userType;
	private Date createTime;
	private Date operateTime;
	private byte identifier;
	private byte status;
	private String remark;
	private boolean mustUpdatePwdFlag;
	private Set<AuthGroup> authGroups = new HashSet<AuthGroup>(0);
	private Set<SysUserOrganize> sysUserOrganizes = new HashSet<SysUserOrganize>(
			0);

	public SysUser() {
	}

	public SysUser(String userName, String userPassword, byte userType,
			Date createTime, byte identifier, byte status,
			boolean mustUpdatePwdFlag) {
		this.userName = userName;
		this.userPassword = userPassword;
		this.userType = userType;
		this.createTime = createTime;
		this.identifier = identifier;
		this.status = status;
		this.mustUpdatePwdFlag = mustUpdatePwdFlag;
	}

	public SysUser(UserBaseInfo userBaseInfoByOperatorId,
			UserBaseInfo userBaseInfoByUserBaseInfoId,
			UserBaseInfo userBaseInfoByCreaterId, String userName,
			String userPassword, byte userType, Date createTime,
			Date operateTime, byte identifier, byte status, String remark,
			boolean mustUpdatePwdFlag, Set<AuthGroup> authGroups,
			Set<SysUserOrganize> sysUserOrganizes) {
		this.userBaseInfoByOperatorId = userBaseInfoByOperatorId;
		this.userBaseInfoByUserBaseInfoId = userBaseInfoByUserBaseInfoId;
		this.userBaseInfoByCreaterId = userBaseInfoByCreaterId;
		this.userName = userName;
		this.userPassword = userPassword;
		this.userType = userType;
		this.createTime = createTime;
		this.operateTime = operateTime;
		this.identifier = identifier;
		this.status = status;
		this.remark = remark;
		this.mustUpdatePwdFlag = mustUpdatePwdFlag;
		this.authGroups = authGroups;
		this.sysUserOrganizes = sysUserOrganizes;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "OPERATOR_ID")
	public UserBaseInfo getUserBaseInfoByOperatorId() {
		return this.userBaseInfoByOperatorId;
	}

	public void setUserBaseInfoByOperatorId(
			UserBaseInfo userBaseInfoByOperatorId) {
		this.userBaseInfoByOperatorId = userBaseInfoByOperatorId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_BASE_INFO_ID")
	public UserBaseInfo getUserBaseInfoByUserBaseInfoId() {
		return this.userBaseInfoByUserBaseInfoId;
	}

	public void setUserBaseInfoByUserBaseInfoId(
			UserBaseInfo userBaseInfoByUserBaseInfoId) {
		this.userBaseInfoByUserBaseInfoId = userBaseInfoByUserBaseInfoId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CREATER_ID")
	public UserBaseInfo getUserBaseInfoByCreaterId() {
		return this.userBaseInfoByCreaterId;
	}

	public void setUserBaseInfoByCreaterId(UserBaseInfo userBaseInfoByCreaterId) {
		this.userBaseInfoByCreaterId = userBaseInfoByCreaterId;
	}

	@Column(name = "USER_NAME", nullable = false, length = 50)
	public String getUserName() {
		return this.userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name = "USER_PASSWORD", nullable = false, length = 32)
	public String getUserPassword() {
		return this.userPassword;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	@Column(name = "USER_TYPE", nullable = false)
	public byte getUserType() {
		return this.userType;
	}

	public void setUserType(byte userType) {
		this.userType = userType;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CREATE_TIME", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "OPERATE_TIME", length = 19)
	public Date getOperateTime() {
		return this.operateTime;
	}

	public void setOperateTime(Date operateTime) {
		this.operateTime = operateTime;
	}

	@Column(name = "IDENTIFIER", nullable = false)
	public byte getIdentifier() {
		return this.identifier;
	}

	public void setIdentifier(byte identifier) {
		this.identifier = identifier;
	}

	@Column(name = "STATUS", nullable = false)
	public byte getStatus() {
		return this.status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	@Column(name = "REMARK", length = 200)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "MUST_UPDATE_PWD_FLAG", nullable = false)
	public boolean isMustUpdatePwdFlag() {
		return this.mustUpdatePwdFlag;
	}

	public void setMustUpdatePwdFlag(boolean mustUpdatePwdFlag) {
		this.mustUpdatePwdFlag = mustUpdatePwdFlag;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "sys_user_auth_group", joinColumns = { @JoinColumn(name = "USER_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "GROUP_ID", nullable = false, updatable = false) })
	public Set<AuthGroup> getAuthGroups() {
		return this.authGroups;
	}

	public void setAuthGroups(Set<AuthGroup> authGroups) {
		this.authGroups = authGroups;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "sysUser")
	public Set<SysUserOrganize> getSysUserOrganizes() {
		return this.sysUserOrganizes;
	}

	public void setSysUserOrganizes(Set<SysUserOrganize> sysUserOrganizes) {
		this.sysUserOrganizes = sysUserOrganizes;
	}

}
